cmake_minimum_required(VERSION 3.10.0)
project(ThreadPool VERSION 0.1.0 LANGUAGES C CXX)

SET(CMAKE_CXX_STANDARD 17)

# 定义严格的编译器警告选项
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
    set(STRICT_WARNINGS -Wall)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
    set(STRICT_WARNINGS /W4)
endif()

ADD_DEFINITIONS(-DUSE_MOVE_ONLY_FUNCTION_FOR_INTERNAL_TASK)

add_executable(TestMain main.cpp)
add_executable(TestBenchmark main_test_benchmark.cpp task_benchmark.cpp)
add_executable(TestUnmoveable main_test_unmoveable_task.cpp)

# 为每个目标应用严格的警告选项
target_compile_options(TestMain PRIVATE ${STRICT_WARNINGS})
target_compile_options(TestBenchmark PRIVATE ${STRICT_WARNINGS})
target_compile_options(TestUnmoveable PRIVATE ${STRICT_WARNINGS})